package com.bigmi.wemedia.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bigmi.model.common.dtos.ResponseResult;
import com.bigmi.model.wemedia.pojos.WmChannel;
import com.bigmi.wemedia.mapper.WmChannelMapper;
import com.bigmi.wemedia.service.WmChannelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Slf4j
@Transactional
public class WmChannelServiceImpl extends ServiceImpl<WmChannelMapper, WmChannel> implements WmChannelService {
    @Autowired
    private WmChannelMapper wmChannelMapper;

    @Override
    public ResponseResult finAll() {
        //查询频道是否被禁用
        LambdaQueryWrapper<WmChannel> queryWrapper =new LambdaQueryWrapper<>();
        queryWrapper.eq(WmChannel::getStatus,1);
        //List<WmChannel> list = list();
        List<WmChannel> list = wmChannelMapper.selectList(queryWrapper);
        return ResponseResult.okResult(list);
    }
}
